var express = require('express');
var router = express.Router();
const parking = require('../dao/parking_dao')

/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send('我是parking');
});

// 获取车位信息
router.get('/getParkData', function(req, res, next) {
    parking.getParkData(req, res);
});

// 新增车位
router.post('/addParkData', function(req, res, next) {
    parking.addParkData(req, res);
});

// 删除车位
router.get('/delParkData', function(req, res, next) {
    parking.delParkData(req, res);
});

// 编辑车位
router.post('/editParkData', function(req, res, next) {
    parking.editParkData(req, res);
});

// 修改状态
router.post('/updateParkData', function(req, res, next) {
    parking.updateParkData(req, res);
});


// 获取车位订单
router.get('/getParkOrder', function(req, res, next) {
    parking.getParkOrder(req, res);
});
// 编辑车位订单
router.post('/editParkOrder', function(req, res, next) {
    parking.editParkOrder(req, res);
});
// 用户车位缴费
router.post('/payParkOrder', function(req, res, next) {
    parking.payParkOrder(req, res);
});


module.exports = router;